<template>
  <div>
    <h3>小三组件</h3>
    <div>金钱：{{ money }}</div>
    <button @click="buyCarFn">买车-50</button>
  </div>
</template>

<script>
import { mapState } from "vuex";
export default {
  computed: mapState(["money"]),
  methods: {
    buyCarFn() {
      this.$store.commit("buyCar", {
        car: "玛莎拉蒂",
        val: 50,
      });
    },
  },
};
</script>

<style></style>
